# -*- coding: utf-8 -*-

class Person:
    def __init__(self,name,age,sex):
        self.name = name
        self.age = age
        self.sex = sex

    def show(self):
        pass


class Student(Person):
    def __init__(self, name, age, sex, hobby):
        super(Student, self).__init__(name, age, sex)
        self.hobby = hobby

    def __str__(self):

        return ('name={}; age={}; sex={}; hobby={}'.format(self.name, self.age, self.sex, self.hobby))

    def show(self):
        print ('name={}; age={}; sex={}; hobby={}'.format(self.name, self.age, self.sex, self.hobby))


class Teacher(Person):
    def __init__(self, name, age, sex, subject):
        super(Teacher, self).__init__(name, age, sex)
        self.subject=subject


    def show(self):
        print('name={}; age={}; sex={}; subject={}'.format(self.name, self.age, self.sex, self.subject))

if __name__ == '__main__':
    student = Student('张三',22,'male', 'playing pingpong')
    print(student)
    student.show()

    teacher = Teacher('李老师', 32, 'male', 'math')
    print(teacher)
    teacher.show()